#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>

using namespace std;

vector<int> vi = {1, 3, 2, 4, 5, 7, 6, 6};

void test1()
{
    partial_sort(vi.begin(), vi.begin() + 3, vi.end());
    for (auto i : vi)
    {
        cout << i << " ";
    }
    cout << endl;
}

void test2()
{
    nth_element(vi.begin(), vi.begin() + 5, vi.end());
    for (auto i : vi)
    {
        cout << i << " ";
    }
    cout << endl;
}

int main()
{
    test2();
    return 0;
}
